package de.htwg_konstanz.ebus.framework.junitTests;

import org.junit.Test;

import de.htwg_konstanz.ebus.framework.impEx.IExporter;
import de.htwg_konstanz.ebus.framework.impEx.IImporter;
import de.htwg_konstanz.ebus.framework.impEx.XmlExporter;
import de.htwg_konstanz.ebus.framework.impEx.XmlImporter;
import de.htwg_konstanz.ebus.framework.view.ImpExStatusModel;


public class ImpExTest {
	
	@Test
	public void testImport() {
		IImporter importer = new XmlImporter(
				"resources/import/bmecat_new_catalog_1_2_simple_without_NS.xsd",
				"resources/import/articles_bmecat_new_catalog_1_2_simple_without_NS.xml");

		System.out.println(importer.isValid());
		importer.performImport();
		ImpExStatusModel status = importer.getStatusModel();
		
		assert(status.getProcessedArticles() == 3);
		
	}
	
	@Test
	public void testExportAsXml() {
		IExporter exporter = new XmlExporter();
		exporter.performExport();
	}
	
	@Test
	public void testExportAsXmlSelective() {
		IExporter exporter = new XmlExporter();
		exporter.performExport("Bleistift");
	}
	
	@Test
	public void testExportAsXhtml() {
		IExporter exporter = new XmlExporter("resources/XHTML.xslt");
		exporter.performExport();
		
		
	}
	
	@Test
	public void testExportAsXhtmlSelective() {
		IExporter exporter = new XmlExporter("resources/XHTML.xslt");
		exporter.performExport("Bleistift");
	}
	
}
